package com.bmmtwabp.employeedashbord;

import com.bmmtwabp.employeedashbord.util.*;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;

/**
 * @Description: 项目启动类
 * @Param:
 * @return:
 * @Author: fenghouzhi
 * @Date: 2018/8/27
 */
@Slf4j
@EnableScheduling
@MapperScan("com.bmmtwabp.employeedashbord.dao")
@SpringBootApplication
public class EmployeedashbordApplication {

  public static void main(String[] args) {
    SpringApplication.run(EmployeedashbordApplication.class, args);
    if (CodeUtil.ACCESSTOKENVO == null) {
      CodeUtil.getAccesstoken();
    }
    log.info("项目启动完成,本机IP: {}", IpUtil.getLocalIP());
  }

  @Bean
  public ThreadPoolTaskScheduler taskScheduler() {
    ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
    return taskScheduler;
  }

}